home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 5 / CHASSIS_ / MAINWIND.C < prev    next >
Text File  |  1992-05-14  |  1KB  |  59 lines

  1. /************************************************************************************/
  2. /*    MainWindowProc                                                                    */
  3. /************************************************************************************/
  4.  
  5. #include "MyHeaders.h"
  6.  
  7. int MainWindowProc()
  8. {
  9.     int        MainWindRetCode = 0;
  10.     
  11.     windSub = 0;                                /* point to window record            */
  12.     SetPort (windTbl[windSub].windPtr);            /* set as the grafPort                */
  13.  
  14.     workPoint = myEvent.where;
  15.     GlobalToLocal(&workPoint);
  16.  
  17.     switch (myEvent.what)                        /* how did I get here?                */
  18.         {
  19.         case (mouseDown):                        /* MouseDown?                        */
  20.             switch (myMouseWhere)                /*   What part of window?            */
  21.                 {
  22.                 case (inContent):                /*     content region:                */
  23.                 break;
  24.                 
  25.                 case (inDrag):                    /*     drag region:                    */
  26.                     DragWindow (windTbl[windSub].windPtr,
  27.                                 myEvent.where, &myDragRect);
  28.                 break;
  29.                 
  30.                 case (inGrow):                    /*     grow region:                    */
  31.                 break;                            /*       do nothing                    */
  32.                 
  33.                 case (inGoAway):                /*     goaway region:                */
  34.                 break;                            /*         no goaway region            */
  35.                 }
  36.              
  37.         break;
  38.         
  39.         case(autoKey):                            /* beep for non command-key events    */
  40.         case(keyDown):
  41.             SysBeep(0);
  42.         break;
  43.         
  44.         case (activateEvt):
  45.             j = (int) BitAnd(myEvent.modifiers, activeFlag);
  46.  
  47.             if (j)                                /* if activate...                    */
  48.                 {
  49.                 WorkRetCode = MenuUpdate(ProcMain);            /* set the menus        */
  50.                 }
  51.             else                                /* if deactivate...                    */
  52.                 {
  53.                 }
  54.         break;
  55.         }
  56.  
  57.     return MainWindRetCode;
  58. }
  59.